var e = getApp();

Page({
    data: {
        list: ""
    },
    onLoad: function(e) {
        this.getdata();
    },
    addUser: function() {
        wx.navigateTo({
            url: "/packageE/energy/AddfamilyMember/AddfamilyMember"
        });
    },
    goAdd: function(e) {
        var t = e.currentTarget.dataset.id;
        wx.navigateTo({
            url: "/packageE/energy/AddfamilyMember/AddfamilyMember?id=" + t
        });
    },
    onReady: function() {},
    onShow: function() {
        this.getdata();
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    deluser: function(t) {
        var n = t.currentTarget.dataset.id.uid, a = e.getNetAddresss("plugin.energy-cabin.frontend.user-terminal.del-family-member"), o = this, i = {
            card_id: o.data.list.id,
            family_user_id: n
        };
        e._getNetWork({
            url: a,
            data: i,
            success: function(e) {
                var t = e.data;
                1 == t.result ? (console.log(t), wx.showToast({
                    title: t.msg,
                    icon: "none",
                    duration: 1e3
                }), o.getdata()) : wx.showToast({
                    title: t.msg,
                    icon: "none",
                    duration: 1e3
                });
            },
            fail: function(e) {
                console.log(e);
            }
        });
    },
    getdata: function() {
        var t = e.getNetAddresss("plugin.energy-cabin.frontend.user-terminal.get-family-member"), n = this;
        e._getNetWork({
            url: t,
            success: function(e) {
                var t = e.data;
                1 == t.result && (console.log(t), n.setData({
                    list: t.data
                }));
            },
            fail: function(e) {
                console.log(e);
            }
        });
    }
});